<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
error_reporting (E_ALL);
define ('DIR', DIRECTORY_SEPARATOR) ;

$sitePath = realpath(dirname(__FILE__) . DIR . '..' . DIR) . DIR ;
define ('SITEPATH', $sitePath) ;

require_once 'includs/startup.php' ;
$registry = new Access_Registry ;

$template = new Access_Template($registry) ;
$registry->set ('view', $template) ;
require_once 'app/access/db.php' ;

$db = new Access_Db ;

$router = new Access_Router($registry);

$registry->set('sitePath', DIR . $db->path) ; 

$registry->set ('router', $router);

$registry->set('controllersPath', 'app/controller') ;

$router->setPath ($registry->get('controllersPath')) ;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title></title>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<link rel="stylesheet" href="/<?php echo $db->path ; ?>style.css" type="text/css" media="screen, projection" />
        <script type="text/javascript" src="/<?php echo $db->path ; ?>public/js/prototype.js"></script>
        <script type="text/javascript" src="/<?php echo $db->path ; ?>public/js/scriptaculous.js?load=effects,builder"></script>
        <script type="text/javascript" src="/<?php echo $db->path ; ?>public/js/lightbox.js"></script>
        <link rel="stylesheet" href="/<?php echo $db->path ; ?>public/css/lightbox.css" type="text/css" media="screen" />
        <!-- TinyMCE -->
        <script type="text/javascript" src="/<?php echo $db->path ; ?>public/js/tiny_mce/tiny_mce.js"></script>
        <script type="text/javascript">
                tinyMCE.init({
                        mode : "textareas",
                        theme : "simple"
                });
        </script>
        <!-- /TinyMCE -->
</head>

<body>

<div id="top">
    <div id="find">
        <form action="index.php" method="get" class="findform">
            <input type="text" size="100" value="search" onfocus="if (this.value == this.defaultValue){this.value = '';}" />
            <input type="submit" value="find" />
        </form>
        <a href="#">extendet search</a>
    </div>
    <div id="login">
        
        <form action="#" method="get" class="loginform">
			Wellcome %username%, you are not loged on yet. 
            <input type="text" size="50" value="login" onfocus="if (this.value == this.defaultValue){this.value = '';}" />
            <input type="text" size="50" value="pass" onfocus="if (this.value == this.defaultValue){this.value = '';}"/>
            <input type="submit" value="in" />
        </form>
    </div>
</div>

<div id="wrapper">

	<div id="header">
            <div id="info">
                <ul id="infomenu">
                    <li><a href="#">Home</a></li>
                    <li><a href="#">Delivery</a></li>
                    <li><a href="#">Pay</a></li>
                    <li><a href="#">About</a></li>
                    <li><a href="#">Contact</a></li>
                </ul>
            </div>
            <div id="logo"></div>
	</div><!-- #header-->

	<div id="middle">

		<div id="container">
			<div id="content">
				<div class="titlebar">Content</div>
<?php
$router->delegate();     
?>
</div><!-- #content-->
		</div><!-- #container-->

		<div class="sidebar" id="sideLeft">
			<div class="titlebar">Menu</div>

                        <?php require_once 'app/views/menu.php' ; ?>

                </div><!-- .sidebar#sideLeft -->

		<div class="sidebar" id="sideRight">
			<div class="titlebar">What is new</div>
			<h4>Design is almost complete.</h4>
			<p>The next stage of the design database. Then begin to write code.</p>
		</div><!-- .sidebar#sideRight -->

	</div><!-- #middle-->

</div><!-- #wrapper -->

<div id="footer">
	<p>All right reserved.</p>
	<p>made by dmitry</p>
</div><!-- #footer -->

</body>
</html>
